
<!-- right-->
<div class="member-main">
  <div style="height:auto">
    <div class="title"><{t}>订单信息<{/t}></div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" class="order-info" style="margin:10px 0 20px 0">
      <tr>
	  <!-- order status -->
        <td width="30%" valign="top"><ul>
            <li><{t}>订单号：<{/t}><span class="price-normal"><{$order.order_id}></span></li>
            <li><{t}>订单金额：<{/t}><span class="point"><{$order.total_amount|cur_odr:$order.currency}></span></li>
            <li><{t}>订单状态：<{/t}><span class="siteparttitle-blue"><{if $order.status == 'dead'}><{t}>已作废<{/t}><{elseif $order.status == 'finish'}><{t}>已完成<{/t}><{else}><{if $order.pay_status == '0'}><{t}>未付款<{/t}><{elseif $order.pay_status == '1'}><{t}>已支付<{/t}><{elseif $order.pay_status == '2'}><{t}>已付款至担保方<{/t}><{elseif $order.pay_status == '3'}><{t}>部分付款<{/t}><{elseif $order.pay_status == '4'}><{t}>部分退款<{/t}><{else}><{t}>全额退款<{/t}><{/if}> <{if $order.ship_status == '0'}><{t}>[未发货]<{/t}><{elseif $order.ship_status == '1'}><{t}>已发货<{/t}><{elseif $order.ship_status == '2'}><{t}>部分发货<{/t}><{elseif $order.ship_status == '3'}><{t}>部分退货<{/t}><{else}><{t}>已退货<{/t}><{/if}><{/if}></span></li>
          </ul>
		</td>
		<!-- order action -->
        <td width="50%" valign="top"><div class="explan"><{if $order.pay_status == '0' || $order.pay_status == '3'}><{t}> 说明： 您选择了<{/t}><{$order.payinfo.pay_app_id|pay_name}><{t}>付款,请根据支付 方式说明进行付款，付款后可通过 网站信息联系我们。 <{/t}><{elseif $order.pay_status == '1' && ($order.ship_status == '0' || $order.ship_status == '2')}><{t}>说明：店家已经收到您的付款，正在备货，稍后将会发货。<{/t}><{elseif $order.ship_status == '1'}><{t}>说明：店家已经发货，请您关注货物的物流状态。<{/t}><{elseif $order.pay_status=='5' && $order.ship_status != '4'}><{t}>店家已经退款<{/t}><{$order.total_amount|cur_odr:$order.currency}><{t}>(说明：金额数字)，请注意查看您的支付账户。<{/t}><{elseif $order.ship_status == '4' && $order.pay_status!='5'}><{t}>店家已经处理退货<{/t}><{elseif $order.pay_status=='5' && $order.ship_status== '4'}><{t}>店家已经退款<{/t}><{$order.total_amount|cur_odr:$order.currency}><{t}>(说明：金额数字)，请注意查看您的支付账户。<{/t}><br /><{t}>店家已经处理退货<{/t}><{elseif $order.status == 'finish'}><{t}>说明：已到货，订单完成<{/t}><{/if}></div></td>
        <td width="20%" valign="top" align="right" style="padding-right:20px">
		<{if $order.payinfo.pay_app_id != '-1'}>
		<div id="order_detail_act_area">
		<{if ($order.pay_status == '0' || $order.pay_status == '3') && $order.status != 'dead' && $order.status != 'finish'}>
			<!-- <input type="button" class="btn  btn-mod-paymethod" name="chage-btn" action_url="<{link app=b2c ctl="site_member" act="orderPayments" arg0=$order.order_id arg1="true"}>" value="<{t}>修改付款方式<{/t}>" /> -->
			<button class="btn chag-bg btn-mod-paymethod" name="chage-btn" action_url="<{link app=b2c ctl="site_member" act="orderPayments" arg0=$order.order_id arg1="true"}>" value="<{t}>修改付款方式<{/t}>"><span><span>修改付款方式</span></span></button>
			  <{if $order.payinfo.pay_app_id != 'offline'}>
			  <!-- <input type="button" class="btn pay-bg btn_go_pay" name="pay-btn" action_url="<{link app=b2c ctl="site_member" act="orderPayments" arg0=$order.order_id}>" value="<{t}>去付款<{/t}>" /> -->
			  <button class="btn submit-btn pay-bg btn_go_pay" name="pay-btn" action_url="<{link app=b2c ctl="site_member" act="orderPayments" arg0=$order.order_id}>" value="<{t}>去付款<{/t}>"><span><span>去付款</span></span></button>
			  <{else}>
			  <!-- <input type="button" class="btn pay-bg btn_already_payed" name="pay-btn" action_url="<{link app=b2c ctl="site_member" act="add_order_msg" arg0=$order.order_id arg1='1'}>" value="<{t}>我已经付款<{/t}>" /> -->
			  <button class="btn submit-btn  pay-bg btn_already_payed" name="pay-btn" action_url="<{link app=b2c ctl="site_member" act="add_order_msg" arg0=$order.order_id arg1='1'}>" value="<{t}>我已经付款<{/t}>"><span><span>我已经付款</span></span></button>
			  <{/if}>
		  <{/if}>
		</div>
		<{/if}>
          <div class="lave-word"><a href="javascript:void(0);" id="odr_msg"  class=" btn-w" title="order_msg" action_url='<{link app=b2c ctl="site_member" act="add_order_msg" arg0=$order.order_id}>'><{t}>我要留言<{/t}></a></div>
	  </td>
      </tr>
    </table>
    <!-- common order info -->
    <div class="order-track" style="border:none">
      <div id="order_des" class="switch">
    <ul class="switchable-triggerBox clearfix">
        <li class="active"><a href="javascript:void(0);"><{t}>订单追踪<{/t}></a></li>
        <{if $order.pay_status > 0}><li><a href="javascript:void(0);"><{t}>付款信息<{/t}></a></li><{/if}>
    </ul>
    <div class="switchable-content">
		<div class="switchable-panel">
			<div class="box">
        <div class="flow">
          <table cellspacing="0" cellpadding="0" border="0" width="100%">
			<{if $order.payinfo.pay_app_id != '-1'}>
            <tr>
              <td class="box-td"><{t}>提交订单<{/t}></td>
              <td class="box-td"><{if $order.pay_status == '0'}><span class="point"><{t}>等待确认<{/t}></span><{else}><{t}>等待确认<{/t}><{/if}></td>
              <td class="box-td"><{if $order.pay_status == '1' && ($order.ship_status == '0' || $order.ship_status == '2')}><span class="point"><{/if}><{t}>捡配货物<{/t}><{if $order.pay_status == '1' && ($order.ship_status == '0' || $order.ship_status == '2')}></span><{/if}></td>
              <td class="box-td"><{if $order.ship_status == '1'}><span class="point"><{t}>店家发货<{/t}></span><{else}><{t}>店家发货<{/t}><{/if}></td>
            </tr>
            <tr>
              <td colspan="5" class="flow-bg"><div class="flow-bg bg<{if $order.pay_status == '0' || $order.pay_status == '3'}>2<{elseif $order.pay_status == '1' && $order.ship_status == '0'}>3<{elseif $order.ship_status == '1' || $order.ship_status == '2'}>4<{else}>5<{/if}>"></div></td>
            </tr>
			<{else}>
			<tr>
              <td class="box-td"><{t}>提交订单<{/t}></td>
              <td class="box-td"><{t}>等待确认<{/t}></td>
              <td class="box-td"><{if $order.ship_status == '0' || $order.ship_status='2'}><span class="point"><{t}>捡配货物<{/t}></span><{else}><{t}>捡配货物<{/t}><{/if}></td>
			  <td class="box-td"><{if $order.ship_status == '1'}><span class="point"><{t}>店家发货<{/t}></span><{else}><{t}>店家发货<{/t}><{/if}></td>
            </tr>
            <tr>
              <td colspan="5" class="flow-bg"><div class="flow-bg <{if $order.ship_status == '0' || $order.ship_status='2'}>three<{elseif $order.ship_status == '1'}>four<{/if}>"></div></td>
            </tr>
			<{/if}>
          </table>
        </div>

		<{if $orderlogs}>

		<{foreach from=$orderlogs item=log_item name="logs_items"}>
        <p><{$log_item.alttime|cdate:FDATE_STIME}>&nbsp;&nbsp;<{$log_item.log_text}></p>
		<{/foreach}>

		<{/if}>

      </div>
		</div>
        <div class="switchable-panel" style="display: none;">
		<{foreach from=$paymentlists item=payment_item name="item_payment"}>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<th><{t}>付款金额：<{/t}></th>
				<td><{$payment_item.money|cur_odr:$order.currency}></td>
			</tr>
			<tr>
				<th><{t}>付款方式：<{/t}></th>
				<td><{$payment_item.pay_app_id|pay_name}></td>
			</tr>
			<tr>
				<th><{t}>付款时间：<{/t}></th>
				<td><{$payment_item.t_payed|cdate:SDATE_STIME}></td>
			</tr>
			<tr>
				<th><{t}>备注：<{/t}></th>
				<td><{$payment_item.memo}></td>
			</tr>
        </table>
        <{/foreach}>
        </div>
    </div>
</div>
<script>
	(function(){
		if ($('order_detail_act_area')){
			$('order_detail_act_area').addEvent('click', function(e, options){
				var el = $(e.target);
				if (el.hasClass('btn-mod-paymethod')){
					if (el.get('action_url'))
						window.location.href = el.get('action_url');
				}else if(el.hasClass('btn_go_pay')){
					if (el.get('action_url'))
						window.location.href = el.get('action_url');
				}else if (el.hasClass('btn_already_payed')){
					options = Object.append({
						width:window.getSize().x*0.8,
						height:window.getSize().y*0.8
					},options||{});

					var params = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width={width},height={height}';
					params = params.substitute(options);

					if (el.get('action_url'))
						window.open(el.get('action_url')||'about:blank','_blank',params);
				}
			});
		}
		// add odr msg.
		if ($('odr_msg')){
			$('odr_msg').addEvent('click', function(e, options){
				var el = $(e.target);
				options = Object.append({
						width:window.getSize().x*0.8,
						height:window.getSize().y*0.8
					},options||{});

				var params = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width={width},height={height}';
				params = params.substitute(options);

				if (el.get('action_url'))
					window.open(el.get('action_url')||'about:blank','_blank',params);
			});
		}
	})();

var tabs = new Switchable('order_des', {autoplay:false});
</script>

    <div class="CartWrap ">
      <{if count($order.goods_items) > 0}>
      <div style="background:#fff; border: 1px solid #C4D6DA;" class="FormWrap gift-bag">
        <!-- <h4><{t}>商品<{/t}></h4> -->
        <table width="100%" cellspacing="0" cellpadding="3" class="gridlist">
          <col class="span-auto">
          <col class="span-2">
          <col class="span-2">
          <col class="span-3">
          <tr>
            <th class="first"><{t}>商品<{/t}></th>
            <th><{t}>数量<{/t}></th>
            <th><{t}>金额小计<{/t}></th>
            <th><{t}>积分<{/t}></th>
          </tr>
          <tbody>
          <{foreach from=$order.goods_items item=goods name="order_items"}>
		  <{if $goods.product}>
          <tr>
            <td>
			<div class="clearfix horizontal-m">

                  <div class='product-list-img goodpic' isrc="<{$goods.product.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$goods.product.link_url}>' style='width:50px;height:50px; margin:0 auto'> <img src='<{$res_url}>/loading.gif'/> </div>
                <div class="goods-main">
                <div style="width:50%" class="goodinfo">
				<{if $goods.product.link_url}>
                <h6>
                <a target="_blank" class="font-blue" href="<{$goods.product.link_url}>"><{/if}><{$goods.product.name}>
                  <{foreach from=$goods.product.minfo item=minfo key=name}>
                  <{$minfo.label}>：<{$minfo.value}>
                  <{/foreach}><{if $goods.product.link_url}></a>
                  </h6>
                  <{/if}>
                  <{if $goods.product.attr}>
                  <span class="font-gray"><{$goods.product.attr}></span>
				  <{/if}>
				  </div>
                <div style="padding:19px 0" class="good-wrap">
                  <ul>
                    <li class="price-normal"><{$goods.product.price|cur_odr:$order.currency}></li>
                  </ul>
                </div>
                </div>
              </div>
			  </td>
            <td  class="textcenter vm"><{$goods.product.quantity}></td>
            <td  class="textcenter vm point"><{$goods.product.amount|cur_odr:$order.currency}></td>
            <td  class="textcenter vm"><{if $goods.product.score == ''}>0<{else}><{$goods.product.score}><{/if}></td>
          </tr>
		  <{/if}>
          <{if $goods.adjunct_items}>
                <{foreach from=$goods.adjunct_items item=ajuncts name="ajunctsItem"}>
                <tr>
                  <td style="border:none">
				  <div style="margin-left:30px;" class="horizontal-m">

				  <div class='product-list-img goodpic'  isrc="<{$ajuncts.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$ajuncts.link_url}>' style="width:50px;height:50px; margin:0 auto"> <img src='<{$res_url}>/loading.gif'/> </div>

				  <div class="goodinfo">
				  <{if $ajuncts.link_url}>
                  <h6>
                  <a target="_blank" href="<{$ajuncts.link_url}>"><{/if}><{$ajuncts.name}>
                    <{foreach from=$ajuncts.minfo item=minfo key=name}> </br>
                    <{$minfo.label}>：<{$minfo.value}>
                    <{/foreach}><{if $ajuncts.link_url}></a>
                    </h6><{/if}>
					<{if $ajuncts.attr}><br/>
					  <span><{$ajuncts.attr}></span>
					  <{/if}>
					</div>
					</div>
					</td>
                    <td class="Colamount" style="border:none;"align="center"><{$ajuncts.quantity}></td>
                    <td class="Colamount" style="border:none;" align="center"><{$ajuncts.amount|cur_odr:$order.currency}></td>
					<td style="border:none;" align="center"><{if $ajuncts.score == ''}>0<{else}><{$ajuncts.score}><{/if}></td>
                </tr>
                <{/foreach}>
          <{/if}>
          <{if $goods.gift_items}>
		  <{foreach from=$goods.gift_items item=gifts name="giftsItem"}>
			<tr>
				<td>
					  <div style="margin-left:30px" class="horizontal-m">

                      <div class='product-list-img goodpic' isrc="<{$gifts.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$gifts.link_url}>' style='width:50px;height:50px; margin:0 auto'> <img src='<{$res_url}>/loading.gif'/> </div>
					 <h6>
                     <a target="_blank" href="<{$gifts.link_url}>"><{$gifts.name}>
						<{foreach from=$gifts.minfo item=minfo key=name}> </br>
						<{$minfo.label}>：<{$minfo.value}>
						<{/foreach}></a></h6>
						<{if $gifts.attr}><br/>
						  <span><{$gifts.attr}></span>
						  <{/if}>
					</div>
                    </div>
				</td>
					  <td  style="border:none;" align="center"><{$gifts.quantity}></td>
					  <td  class="Colamount"  style="border:none;"align="center"><{*$gifts.price|cur_odr:$order.currency*}><{t}>商品赠送<{/t}></td>
					  <td class="Colamount"  style="border:none;" align="center"><{if $gifts.score == ''}>0<{else}><{$gifts.score}><{/if}></td>
			</tr>
			<{/foreach}>
          <{/if}>
          <{/foreach}>
		  </tbody>
        </table>

        <{/if}>

        <{if $order.gift_items}>
		 <div style="background:#fff; border: 1px solid #C4D6DA;" class="FormWrap gift-bag">
			<h4><{t}>赠品<{/t}></h4>
			<table width="100%" cellpadding="3" cellspacing="0" class="liststyle data gridlist">
			  <col class="span-6">
			  </col>

			  <col class="span-2">
			  </col>

			  <col  class="span-2">
			  </col>

			  <col class="span-2 bg-orange">
			  </col>
			  <thead>
			  <tr>
				<th style="text-align:center" ><{t}>赠品名称<{/t}></th>
				<th style="text-align:center" ><{t}>小计<{/t}></th>
				<th style="text-align:center" ><{t}>数量<{/t}></th>
				<th style="text-align:center" ><{t}>所需积分<{/t}></th>
			  </tr></thead>
			  <{foreach from=$order.gift_items item="item" key="key"}>
			  <tr>
				<td><{$item.name}></td>
				<td style="text-align:center" ><{$item.amount|cur_odr:$order.currency}></td>
				<td style="text-align:center" ><{$item.nums}></td>
				<td style="text-align:center" ><{$item.point}></td>
			  </tr>
			  <{/foreach}>
			</table>

        <{/if}>

		<{if $order.extends_items}>
		<{if count($order.goods_items) <= 0}>
			<div style="background:#fff; border: 1px solid #C4D6DA;" class="FormWrap gift-bag clearfix">
				<!-- <h4><{t}>商品<{/t}></h4> -->
				<table width="100%" cellspacing="0" cellpadding="3" class="gridlist">
				    <col class="span-auto">
				    <col class="span-2">
				    <col class="span-2">
				    <col class="span-3">
				    <tr>
						<th class="first"><{t}>商品<{/t}></th>
						<th><{t}>数量<{/t}></th>
						<th><{t}>金额小计<{/t}></th>
						<th><{t}>积分<{/t}></th>
				    </tr>
				    <tbody><{/if}>
						<div style="background:#fff;" class="gift-bag gridlist clearfix">
							<{foreach from=$order.extends_items item="aExtends"}>
								<{$aExtends}>
							<{/foreach}>
							<{if count($order.goods_items) <= 0}>
					</tbody>
				</table><{/if}>
        <{/if}>

		<{if count($order.order_pmt)>0}>
        <h4><{t}>优惠<{/t}></h4>
        <table cellspacing="0" cellpadding="0" border="0" width="100%" class="favorable">
		<{foreach from=$order.order_pmt item=item}>
          <tr>
            <td class="favorable-th fontbold"><{$item.pmt_memo}></td>
            <td class="bg-orange favorable-td"><{$item.pmt_describe}></td>
          </tr>
		<{/foreach}>
        </table>
		<{/if}>
        <h4><{t}>收货信息<{/t}></h4>
        <table width="100%" cellspacing="0" cellpadding="0" class="takegoods" >
          <tbody>
            <tr>
              <th><{t}>配送地区：<{/t}></th>
              <td><{$order.consignee.area}></td>
            </tr>
            <tr>
              <th><{t}>收货地址：<{/t}></th>
              <td><{$order.consignee.addr}></td>
            </tr>
            <tr>
              <th><{t}>收货人邮编：<{/t}></th>
              <td><{$order.consignee.zip}></td>
            </tr>
            <tr>
              <th><{t}>收货人姓名：<{/t}></th>
              <td><{$order.consignee.name}></td>
            </tr>
            <tr>
              <th><{t}>联系电话：<{/t}></th>
              <td><{if $order.consignee.telephone}><{$order.consignee.telephone}><{if $order.consignee.mobile}> | <{/if}><{/if}><{$order.consignee.mobile}></td>
            </tr>
          </tbody>
        </table>
        <h4><{t}>配送方式<{/t}></h4>
        <table cellspacing="0"  cellpadding="0" border="0" width="100%" class="takegoods">
          <tr>
            <th>配送方式：</th><td><{$order.shipping.shipping_name}></td></tr>
			<tr><th><{t}>配送费用：<{/t}></th><td><span class="point"><{$order.shipping.cost_shipping|cur_odr:$order.currency}></span></td>
          </tr>
        </table>
        <h4><{t}>支付方式<{/t}></h4>
        <table cellspacing="0"  cellpadding="0" border="0" width="100%" class="takegoods">
          <tr>
            <td style="padding-left:40px"><{$order.payinfo.pay_app_id|pay_name}></td>
          </tr>
        </table>
        <h4><{t}>订单备注<{/t}></h4>
        <table cellspacing="0"  cellpadding="0" border="0" width="100%" class="takegoods">
          <tr>
            <td style="padding-left:40px"><{$order.memo}></td>
          </tr>
        </table>

        <h4><{t}>结算信息<{/t}></h4>
		<{include file="site/common/order_total.html" app=b2c}>


    <!-- order info end -->
    <{if $ordermsg}>
      <h4><{t}>订单留言<{/t}></h4>

	  <{foreach from=$ordermsg item=msgitem name="ordermsg"}>

	  <ul>
	    <li class="p5 pl20 pr20 clearfix"><p class="flt w500"><span class="fontbold"><{t}>标题：<{/t}></span><{$msgitem.title}></p><span class="frt"><span class="fontbold"><{t}>留言人：<{/t}></span><{$msgitem.author}></span></li>
	  <li class="p5 pl20 pr20 clearfix"><p class="w500 flt"><span class="fontbold"><{t}>内容：<{/t}></span><{$msgitem.comment|nl2br}></p><span class="frt"><{$msgitem.time|cdate:FDATE_STIME}></span></li>
		  </ul>
       <!-- <table border="0" cellspacing="0" cellpadding="0" class="liststyle data" width="99%"  style="table-layout:fixed;border:none">
		<col style="width:80%"/>
		<col />
			<tr>
				<td class="border-bottom"><{t}>标题：<{/t}><{$msgitem.title}></td>
				<td class="border-bottom"><{t}>留言人：<{/t}><{$msgitem.author}></td>
			</tr>
			<tr>
            <td><{t}>内容：<{/t}><{$msgitem.comment|nl2br}></td>
            <td><{t}>时间：<{/t}><{$msgitem.time|cdate:FDATE_STIME}></td>
          </tr>
        </table> -->
		<{/foreach}>

    <{/if}>

</div></div></div></div></div>
<script>
function show_delivery_item(cur_obj,key,item_info){
    if($(cur_obj).getParent().getNext("div[id="+key+"]")){
        var obj = $(cur_obj).getParent().getNext("div[id="+key+"]");
        if(obj.style.display == 'none'){
            obj.style.display = '';
        }else{
            obj.style.display = 'none';
        }
    }else{
        var div1 = new Element("div",{
                'id' : key,
                'style' : 'overflow:hidden;height:100%;width:96%',
                'class' : 'note'
            }).inject($(cur_obj).getParent(),'after');
        var div2 = new Element('div',{
                'style' : 'clear:left'
            }).inject(div1);

        item_info.each(function(item){
                new Element('div',{'class':'span-9'}).set('text','<{t}>购买的商品：<{/t}>'+item['name']).inject(div2);
                new Element('div',{'class':'span-9'}).set('text','<{t}>数量：<{/t}>'+item['number']).inject(div2);
            });
    }
}

/*小图mouseenter效果*/
window.addEvent('domready',function(){

  var cart_product_img_viewer=new Element('div',{styles:{'position':'absolute','zIndex':500,'opacity':0,'border':'1px #666 solid'}}).inject(document.body);

  var cpiv_show=function(img,event){

      if(!img)return;
      cart_product_img_viewer.empty().adopt($(img).clone().removeProperties('width','height').setStyle('border','1px #fff solid')).fade(1);

      var size = window.getSize(), scroll = window.getScroll();
        var tip = {x: cart_product_img_viewer.offsetWidth, y: cart_product_img_viewer.offsetHeight};
        var props = {x: 'left', y: 'top'};
        for (var z in props){
            var pos = event.page[z] + 10;
            if ((pos + tip[z] - scroll[z]) > size[z]) pos = event.page[z] - 10 - tip[z];
            cart_product_img_viewer.setStyle(props[z], pos);
        }

  };

   $$('.FormWrap .product-list-img').each(function(i){

       new Asset.image(i.get('isrc'),{onload:function(img){
	   if(!img)return;
           var _img=img.zoomImg(50,50);
		     if(!_img)return;
           _img.setStyle('cursor','pointer').addEvents({
              'mouseenter':function(e){
                 cpiv_show(_img,e);
              },
              'mouseleave':function(e){
                cart_product_img_viewer.fade(0);
              }
           });
           i.empty().adopt(new Element('a',{href:i.get('ghref'),target:'_blank',styles:{border:0}}).adopt(_img));
       },onerror:function(){
            i.empty();

       }});

   });

});

</script>

<!-- right-->
